#include "httpServer.hpp"
#include <memory>
using namespace Server;
void Usage(char* proc)
{
    std::cerr<<"Usage:\n\t"<<*proc<<"port\r\n\r\n";
}

//./httpServer 8080
int main(int argc,char* argv[])
{
    if(argc!=2)  
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port=atoi(argv[1]);
    std::unique_ptr<HttpServer> httpsvr(new HttpServer(Get,port));
    //进行方法的注册
    //httpsvr->registerCb("/",Get);
    // httpsvr->registerCb("/search",Search);
    // httpsvr->registerCb("/test,py",Other);
    //服务器启动
    httpsvr->InitServer();
    httpsvr->Start();
    return 0;
}